package com.bsoft.mapper.business;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

public interface HosptalOrderBillMapper {

    @Select("select *  from  bq_yzjh where zyh = #{zyh} and ysyzbh = #{ysyzbh} and jhh =#{jhh} and XMZT=0")
    List<Map<String, Object>> getNoSQIDYZJH(Map<String, Object> req);

    @Select("select csz from gy_xtcs where csmc=#{csmc,jdbcType=VARCHAR}")
    String getXtcs(Map<String, Object> wzxhmxWdzkfHcjf);

    @Select("select DISTINCT  yjxh  from zy_bqyz where ysyzbh =#{OrderId} and yjxh != 0")
    Map<String, Object> getJZXH(Map<String, Object> xm);

    @Select("select 1 from gy_ygdm where  ygdm=#{ysdm}")
    List<Map<String, Object>> getYsxx(Map<String, Object> xm);

    @Select("select * from EMR_JCSQ t where sqdh=#{sqdh} and zfbz = 0")
    List<Map<String, Object>> getSqd(Map<String, Object> req);

    @Select("select *  from zy_brry where zyh = #{zyh} and cypb = 0")
    List<Map<String, Object>> zyInfo(Long zyh);

    @Select("select *  from ZY_bqyz  where sqid =#{sqdh} and  ysyzbh=#{ysyzbh} and zfbz=0")
    List<Map<String, Object>> selectBqyz(Map<String, Object> xm);

    @Select("select * from gy_ygdm where  ygdm=#{czgh}")
    List<Map<String, Object>> getNosqIDYSXX(Map<String, Object> req);

    @Select("select  b.jlxh,a.ysyzbh,a.lsbz,a.zyh,a.*  from  zy_bqyz a  left join zy_fymx b on a.zyh=b.zyh and a.jlxh = b.yzxh   where a.zyh = #{zyh} and  a.ysyzbh =#{ysyzbh} and a.zfbz=0")
    List<Map<String, Object>> getNoSQIDBQYZ(Map<String, Object> req);

    @Delete("delete emr_jcbg where sqdh=#{sqdh}")
    int delectJcbg(Map<String, Object> req);

    @Update("update EMR_JCSQ set JCZT=#{jczt} where  sqdh=#{sqdh}")
    void updateEMR_JCSQ(Map<String, Object> req);

    @Update("update zy_bqyz set qrsj=#{OperateDateTime},lsbz=1 where  ysyzbh=#{ysyzbh} and lsbz=0")
    int updateBqyz(Map<String, Object> xm);

    @Update("UPDATE ms_yj01 SET zxrq = #{zxrq} , ZXYS =#{zxys} ,zxpb =#{zxpb}  WHERE sqid =#{sqid} and zfpb = 0 and yjxh =#{YJXH}")
    int updateMSYJ01(Map<String, Object> jzxh);

    @Update("update zy_bqyz set qrsj=null,lsbz=0 where  ysyzbh=#{ysyzbh} and lsbz=1")
    int updateBqyzZf(Map<String, Object> xm);

    @Update("UPDATE BQ_YZJH SET CZR = #{czgh},XMZT = 5 WHERE  zyh = #{zyh} and ysyzbh = #{ysyzbh} and  jhh=#{jhh}")
    int updateNOSQIDBqyz(Map<String, Object> req);

    @Update(" UPDATE BQ_YZJH SET LSBZ = 1,CZR = #{czgh},XMZT = 3 WHERE  zyh = #{zyh} and ysyzbh = #{ysyzbh} and jhh=#{jhh} and XMZT=0")
    int upNoSQIDYZJH(Map<String, Object> req);

    int updateEMR_JCXM(Map<String, Object> req);

    List<Map<String, Object>> getQXMZYZ(Map<String, Object> jzxh);

    List<Map<String, Object>> getMZYZ(Map<String, Object> jzxh);

    int insertJJHS(Map<String, Object> map);

    void saveFymx(Map<String, Object> xm);

    int updateYZJH(Map<String, Object> xm);

    int updateZY01(Map<String, Object> xm);

    int updateZY02(Map<String, Object> xm);

    List<Map<String, Object>> getBQYZ(Map<String, Object> jzxh);

    List<Map<String, Object>> wz1(Map<String, Object> xm);

    List<Map<String, Object>> wz6(Map<String, Object> wzMap);

    List<Map<String, Object>> wz2(Map<String, Object> wzMap);

    int wz3(Map<String, Object> wzMap);

    int wz5(Map<String, Object> wlXhmx);

    void updateEMR_JCSQ1(Map<String, Object> req);

    List<Map<String, Object>> wz1Tf(Map<String, Object> xm);

    int wz3Tf(Map<String, Object> wzMap);

    int updateFymx(Map<String, Object> xm);

    List<Map<String, Object>> getFymxZf(Map<String, Object> xm);

    void saveFymxZf(Map<String, Object> fymx);

    int updateYZJHZf(Map<String, Object> xm);

    int updateZY01Zf(Map<String, Object> xm);

    int updateZY02Zf(Map<String, Object> xm);

    List<Map<String, Object>> getQXBQYZ(Map<String, Object> jzxh);

    List<Map<String, Object>> wz2Tf(Map<String, Object> wzMap);

    int saveNoSQIDFymx(Map<String, Object> req);

    @Update("UPDATE BQ_YZJH SET CZR = #{czgh},XMZT = 5 WHERE zyh = #{zyh} and ysyzbh = #{ysyzbh} and  jhh=#{jhh}")
    int updateNOSQIDBQYZJH(Map<String, Object> xm);

    @Update("update  zy_fymx m set YTSL = 1.0000  where zyh=#{zyh} and jhh=#{jhh}")
    int updateFYMXYTSL(Map<String, Object> xm);

    List<Map<String, Object>> getFYMXZF(Map<String, Object> xm);

    int saveFYMXZF(Map<String, Object> fymx);
}
